package com.imooc.joe_springmvc1.scope;

import com.imooc.joe_springmvc1.aop.DemoAnnotationService;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * Created by joe on 16-8-9.
 */
public class MainText {

    public static void main(String[] args){
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ScopeConfig.class);
        DemoSingletonService s1 = context.getBean(DemoSingletonService.class);
        DemoSingletonService s2 = context.getBean(DemoSingletonService.class);

        DemoPrototypeService s3 = context.getBean(DemoPrototypeService.class);
        DemoPrototypeService s4 = context.getBean(DemoPrototypeService.class);

        System.out.println(s1.equals(s2));
        System.out.println(s3.equals(s4));
        context.close();

    }
}
